from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone

class TodoItem(models.Model):
    task_text = models.CharField(max_length=200, help_text="任务的具体文本内容")
    completed = models.BooleanField(default=False, help_text="是否已完成")
    created_at = models.DateTimeField(auto_now_add=True, help_text="创建时间")
    due_date = models.DateField(null=True, blank=True, help_text="截止日期")
    owner = models.ForeignKey(User, on_delete=models.CASCADE, help_text="任务的负责人")

    def __str__(self):
        return self.task_text